<%@ page import="per.hnvcam.hedge.algebra.HedgeConstants" %>
<%--
  Created by IntelliJ IDEA.
  User: camhoang
  Date: 8/2/11
  Time: 3:54 PM
  To change this template use File | Settings | File Templates.
--%>
<%@include file="include.jsp"%>
<% 
   pageTitle = "Hedge parameters configuration";
   configurationTile = "Configure Hedge Constants";
%>
<%@include file="header.jsp"%>

      <h1>Hedge Parameters</h1>
      <h3><span style="text-decoration: underline">AX</span>=(<%=HedgeConstants.DOMAIN%>, <%=HedgeConstants.GENERATOR%>,
         <%=HedgeConstants.CONSTANT%>, <%=HedgeConstants.HEDGE%>, <%=HedgeConstants.ORDERED_OPERATOR%>)
      </h3>
      <table border="0">
         <tr>
            <td><%=HedgeConstants.DOMAIN%></td>
            <td>=</td>
            <td>${domain}</td>
         </tr>
         <tr>
            <td><%=HedgeConstants.POSITIVE_GENERATOR%></td>
            <td>=</td>
            <td>{${hedgeDefinition.getPositiveG()}}</td>
         </tr>
         <tr>
            <td><%=HedgeConstants.NEGATIVE_GENERATOR%></td>
            <td>=</td>
            <td>{${hedgeDefinition.getNegativeG()}}</td>
         </tr>
         <tr>
            <td><%=HedgeConstants.POSITIVE_HEDGE%></td>
            <td>=</td>
            <td>{${hedgeDefinition.getPositiveH()}}</td>
         </tr>
         <tr>
            <td><%=HedgeConstants.NEGATIVE_HEDGE%></td>
            <td>=</td>
            <td>{${hedgeDefinition.getNegativeH()}}</td>
         </tr>
      </table>
      <h3><a href="<c:url value='/administration/hedge.jhtml?operation=check'/>">Check consistency</a></h3>
      <c:if test="${not empty status}">
         <span style="color:red">${status}.</span>
         <c:if test="${status eq 'Successfully'}">
            <c:forEach items="${domain}" var="x">
               fm(${x}) = <fmt:formatNumber value="${hedgeDefinition.getFunctionMeterValue(x)}" type="Number" maxFractionDigits="4"/>;
            </c:forEach>
         </c:if>
      </c:if>
      <br/>
      <br/>

      <form:form commandName="config">
         <table border="0" cellpadding="3" cellspacing="0">
            <tr>
               <td>fm(<%=HedgeConstants.MANY%>)</td>
               <td><form:input path="functionMeters['Nhi&#7873;u'].value"/></td>
            </tr>
            <tr>
               <td>fm(<%=HedgeConstants.FEW%>)</td>
               <td><form:input path="functionMeters['&#205;t'].value"/></td>
            </tr>
            <tr>
               <td><%=HedgeConstants.FUZZY_VALUE + "(" + HedgeConstants.VERY + ")"%></td>
               <td><form:input path="functionMeters['R&#7845;t'].value"/></td>
            </tr>
            <tr>
               <td><%=HedgeConstants.FUZZY_VALUE + "(" + HedgeConstants.LITTLE + ")"%></td>
               <td><form:input path="functionMeters['H&#417;i'].value"/></td>
            </tr>
            <tr>
               <td><%=HedgeConstants.ALPHA%></td>
               <td><form:input path="alpha" readonly="true"/></td>
            </tr>
            <tr>
               <td><%=HedgeConstants.BETA%></td>
               <td><form:input path="beta" readonly="true"/></td>
            </tr>
            <tr>
               <td colspan="2">
                  <input type="submit" value="Save"/>
               </td>
            </tr>
         </table>
      </form:form>
<%@include file="footer.jsp"%>